package com.lcq.gulimall.ware.dao;

import com.lcq.gulimall.ware.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lcq.gulimall.ware.vo.SkuStockVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author lichuanqi
 * @email lichuanqi0086@163.com
 * @date 2021-02-21 18:00:14
 */
@Mapper
public interface WareSkuDao extends BaseMapper<WareSkuEntity> {

    List<SkuStockVo> hasStocks(@Param("skuIds") List<Long> skuIds);

    int lockWare(@Param("skuId") Long skuId,@Param("quantity") Integer quantity);

    List<WareSkuEntity> getAppropriateWare(@Param("skuId") Long skuId, @Param("quantity") Integer quantity);
}
